from ..UI import alert, confirm, openAC
from .NetUtil import sendACMsg


def checkAC():
    result = sendACMsg(0, '', need_result=1)
    if result == '无障碍未启动':
        print('辅助服务未启动\n')
        ans = confirm('注意', '请在设置界面启动服务')
        if ans == '1':
            openAC()
            return False
            # checkAC()
        else:
            alert('辅助服务未启动')
            print('程序退出\n')
            exit(-1)
    else:
        print("无障碍已启动")
        return True
